package org.example.springaop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * 使用自定义注解的切面类
 */
@Slf4j
@Aspect
@Component
public class MyAspectDemo {
    @Before("@annotation(org.example.springaop.aspect.MyAspect)")
    public void before() {
        log.info("MyAspectDemo.before");
    }

    @After("@annotation(org.example.springaop.aspect.MyAspect)")
    public void after() {
        log.info("MyAspectDemo.after");
    }
}
